﻿<%@ Page Language="C#" Title="儀校申請單查詢作業" AutoEventWireup="true" MasterPageFile="~/default.Master"   CodeBehind="CorrectQuery.aspx.cs" Inherits="InstrumentCheck.WebAppUI.CorrectQuery" %>
<%@ Register src="UserControl/UCSelectAssetNO.ascx" tagname="UCSelectAssetNO" tagprefix="uc1" %>
<%@ Register Src="~/UserControl/UCSelectEmp.ascx" TagName="UCSelectEmp" TagPrefix="uc2" %>
<%@ Register src="UserControl/UCSelectPR.ascx" tagname="UCSelectPR" tagprefix="uc3" %>
<asp:Content  ContentPlaceHolderID="head" runat="server" ID="Content1">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Body" runat="server">

    <script type="text/javascript" src="js/CorrectCheck.js"></script>
     <table  width="800" border="1" cellspacing="0" cellpadding="0" rules="all" frame="box" style="border-style:groove;border-color:Black; text-align :left;">
        <tr>
            <td class="desc">資產類別</td>
            <td  class="descData">
                <asp:DropDownList ID="ddlFasType" runat="server">
                <asp:ListItem Value="" Text="All"></asp:ListItem>
                <asp:ListItem Value="2" Text="列管品"></asp:ListItem>
                <asp:ListItem Value="1" Text="固定資產"></asp:ListItem></asp:DropDownList></td>
            <td class="desc">資產編號</td>
            <td class="descData">
                <asp:TextBox ID="txtAssetNO" runat="server"></asp:TextBox>
                <img ID="imgQueryFasNO" runat="server" alt="Find" onclick="showNewFasNO()"  src="images/imgFind.png"  />
                </td>
        </tr>
        <tr>
            <td class="desc">保管部門</td>
            <td class="descData">
                <asp:DropDownList ID="ddlKeepDept" runat="server">
            
                </asp:DropDownList></td>
            <td class="desc">保管人</td>
            <td class="descData">
                <asp:TextBox ID="txtKeepName" runat="server"></asp:TextBox>
                <img src="images/imgFind.png" runat="server" id="imgQueryKeepName"  onclick="showKeeper()" alt="Find" /></td>
        </tr>
        <tr>
            <td class="desc">品名</td>
            <td class="descData">
                <asp:TextBox ID="txtProductName" runat="server"></asp:TextBox> </td>
            <td class="desc">廠牌</td>
            <td class="descData">
                <asp:TextBox ID="txtVendor" runat="server"></asp:TextBox></td>
        </tr>
        <tr>
            <td class="desc">規格</td>
            <td class="descData">
                <asp:TextBox ID="txtSpec" runat="server"></asp:TextBox> </td>
            <td class="desc">型號</td>
            <td>
                <asp:TextBox ID="txtModelNO" runat="server"></asp:TextBox></td>
        </tr>
         <tr>
            <td class="desc">目前狀態</td>
            <td class="descData">
                <asp:DropDownList ID="ddlNowState" runat="server">
                <asp:ListItem Value="" Text="All"></asp:ListItem>
                <asp:ListItem Value ="1" Text ="需校驗"></asp:ListItem>
                <asp:ListItem Value="4" Text="免檢"></asp:ListItem>
                <asp:ListItem Value="5" Text="暫停使用"></asp:ListItem>
                <asp:ListItem Value="6" Text="禁止使用"></asp:ListItem>
                <asp:ListItem Value="7" Text ="報廢"></asp:ListItem></asp:DropDownList></td>
            <td class="desc">PR單號</td>
            <td class="descData">
                <asp:TextBox ID="txtPRNO" runat="server"></asp:TextBox>
                <img src="images/imgFind.png" id="imgQueryPRNO" onclick = "showPRNO()" runat="server" alt="Find" /></td>
        </tr>
         <tr>
            <td class="desc">校驗結果</td>
            <td class="descData">
                <asp:DropDownList ID="ddlCheckResult" runat="server">
                <asp:ListItem Value="" Text="All"></asp:ListItem>
                <asp:ListItem Value="1" Text="合格"></asp:ListItem>
                <asp:ListItem Value="2" Text="限定使用"></asp:ListItem>
                <asp:ListItem Value="0" Text="不合格"></asp:ListItem>
                </asp:DropDownList></td>
            <td class="desc">簽核狀況</td>
            <td class="descData">
                <asp:DropDownList ID="ddlApprovalState" runat="server">
                <asp:ListItem Value="" Text="All"></asp:ListItem>
                <asp:ListItem Value="2" Text ="同意"></asp:ListItem>
                <asp:ListItem Value="3" Text ="不同意"></asp:ListItem>
                <asp:ListItem Value="1" Text ="簽核中"></asp:ListItem></asp:DropDownList></td>
        </tr>
        <tr>
            <td colspan="4"  align="center" >
                <asp:Button ID="btnQueryDetail"  runat="server" Width="100px" Text="查詢申請單明細" 
                    onclick="btnQueryDetail_Click" />&nbsp;&nbsp;&nbsp;
                <asp:Button ID="btnQueryCount" runat="server" Width="100px" Text="查詢儀器統計資料" 
                    onclick="btnQueryCount_Click" />&nbsp;&nbsp;&nbsp;
                <asp:Button ID="btnImportExcel" runat="server" Text="轉出Excel" OnClick="btnImportExcel_Click" /></td>
        </tr>
        <tr>
            <td colspan="4" class="descData">
               <asp:Panel ID="panGridView" runat="server">
                <asp:GridView ID="gvInfo" runat="server" AutoGenerateColumns = "false" 
                        onrowdatabound="gvInfo_RowDataBound" AllowPaging="true" 
                        PageSize="10" onpageindexchanging="gvInfo_PageIndexChanging" >
                    <Columns>
                        <asp:BoundField HeaderText="財編號碼"  />
                        <asp:BoundField HeaderText="申請單號" DataField="FormNO" HtmlEncode = "false" DataFormatString="{0:0000000000}" />
                        <asp:BoundField HeaderText="品名"  />
                        <asp:BoundField HeaderText="規格"  />
                        <asp:BoundField HeaderText="保管人"  />
                        <asp:BoundField HeaderText="保管部門"  />
                        <asp:BoundField HeaderText="目前狀態" />
                        <asp:BoundField HeaderText="校驗結果" />
                        <asp:BoundField HeaderText="附件"  />
                        <asp:BoundField HeaderText="簽核狀況"/>
                    </Columns>
                </asp:GridView>
                </asp:Panel>
                <asp:Panel ID="panTable" runat="server">
                    <asp:GridView ID="gvCount" runat="server" AutoGenerateColumns = "false" 
                        onrowdatabound="gvCount_RowDataBound">
                    <Columns>
                        <asp:BoundField HeaderText="部門"  DataField="DeptNO" />
                        <asp:BoundField HeaderText="需校驗" DataField="NeedCorrectNum" />
                        <asp:BoundField HeaderText="已校驗"  DataField="AlreadyCorrectNum" />
                        <asp:BoundField HeaderText="未校驗"  DataField="HavenotCorrectNum" />
                        <asp:BoundField HeaderText="免驗"  DataField="AgainstCorrectNum" />
                        <asp:BoundField HeaderText="暫停使用" DataField="PauseInUseNum"  />
                        <asp:BoundField HeaderText="禁用" DataField="ForbidenUseNum" />
                        <asp:BoundField HeaderText="報廢"  DataField="UselessNum"/>
                        <asp:BoundField HeaderText="達成率"  />
                    </Columns>
                </asp:GridView>
                </asp:Panel></td>
        </tr>
     </table>
     <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
      <div id="dvMaster" runat="server" style="position:absolute; z-index:2; background-color:#777777;  left:0;top:0; filter:alpha(opacity=90); display:none"></div>
     <div id="dvNewFasNO"  runat="server" style="position:absolute; z-index:3; width:200px; height:200; display:none">
       <asp:UpdatePanel ID="UpdatePanel1" runat="server">
              <ContentTemplate>
                   <uc1:UCSelectAssetNO ID="UCSelectAssetNO1" runat="server" />
               </ContentTemplate>
        </asp:UpdatePanel>
      </div>
      <div id="dvKeeper" runat="server" style="position:absolute; z-index:3; width:auto;height:auto; display:none; background-color :White;">
        <asp:UpdatePanel ID="UpdatePanel2" runat="server">
            <ContentTemplate >
                <uc2:UCSelectEmp ID="UCSelectEmp1" runat="server" />
            </ContentTemplate>
        </asp:UpdatePanel>
      </div>
      <div id="dvPRNO" runat="server" style="position:absolute; z-index:3; width: auto;height:auto; background-color:White; display:none">
        <asp:UpdatePanel ID="UpdatePanel3" runat="server">
            <ContentTemplate>
                <uc3:UCSelectPR ID="UCSelectPR1" runat="server" />
            </ContentTemplate>
        </asp:UpdatePanel>
      </div>
</asp:Content>
